package com.panshi.vo;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

@Data
public class ItemQueryUserVo {
    @ApiModelProperty("当前页")
    private Integer current;
    @ApiModelProperty("用户Id")
    private Long id;
    @ApiModelProperty("新密码")
    private String pwd;
    @ApiModelProperty("原密码")
    private String oldPwd;
    @ApiModelProperty("个人简介")
    private String motto;
    @ApiModelProperty("昵称")
    private String nickname;
    @ApiModelProperty("问题数量")
    private Integer questionNum;
    @ApiModelProperty("回答数量")
    private Integer answerNum;
    @ApiModelProperty("文章数量")
    private Integer articleNum;
    @ApiModelProperty("总记录数")
    private Integer total;
    @ApiModelProperty("分页大小")
    private Integer pageSize;
    @ApiModelProperty("用户头像File")
    private String file;
    @ApiModelProperty("是否审核通过")
    private Integer type;
    //获取当前查询页的起始下标
    public Integer getStartIndex() {
        Integer value = 0;
        if(current == null || current == 0) {
            value = 0;
        }else if(current != null) {
            value = (current-1)*getPageSize();
        }
        return value;
    }
    public Integer getPageSize() {
        Integer value = 0;
        if(pageSize == null || pageSize == 0) {
            value = 10;
        }else if(pageSize!=null) {
            value = pageSize;
        }
        return value;
    }

}
